import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import ProductsView from '@/views/ProductsView.vue'
import ContactsView from '@/views/ContactsView.vue'
import KnowledgeView from '@/views/KnowledgeView.vue'
import AboutView from '@/views/about/AboutView.vue'
import AdvantageView from '@/views/about/AdvantageView.vue'
import QualityView from '@/views/about/QualityView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      component: AboutView
    },
    {
      path: '/about/advantage',
      name: 'advantage',
      component: AdvantageView
    },
    {
      path: '/about/quality',
      name: 'quality',
      component: QualityView
    },
    {
      path: '/products',
      name: 'products',
      component: ProductsView
    },
    {
      path: '/products/:id',
      name: 'productDetail',
      component: () => import('@/views/ProductDetailView.vue'),
      props: true
    },
    {
      path: '/contacts',
      name: 'contacts',
      component: ContactsView
    },
    {
      path: '/knowledge',
      name: 'knowledge',
      component: KnowledgeView
    }
  ]
})

export default router
